import React from 'react';
import styles from './index.less';
import { Modal } from 'antd';

const planIcon = 'https://10.4.6.209:8084/typeface/image/plan_icon.png';

export default (props) => {
  const { open = false, width = 720, title, titleIcon = planIcon, ...others } = props;
  return (
    <Modal
      visible={open}
      width={width}
      className={styles.tr_modal}
      centered={true}
      maskClosable={false}
      getContainer={document.body}
      destroyOnClose={true}
      title={
        <div key="title" className={styles.tr_modal_title}>
          <img src={titleIcon} />
          {title}
        </div>
      }
      {...others}
    >
      {props.children}
    </Modal>
  );
};
